------------------------------------------------------
--
-- classe principale del gioco lato server
--
--
--
------------------------------------------------------
with Field_Package;		use Field_Package;
with Ball_Package;		use Ball_Package;
with Timer_Package;		use Timer_Package;
with TimeCount_Package; use TimeCount_Package;
with TaskBall_Package;  use TaskBall_Package;
with Player_Package;	use Player_Package;
with Manager_Package;	use Manager_Package;
with Referee_Package;	use Referee_Package;

package Server is
    
	-- dichiarazione di oggetto remoto
	-- pragma Remote_Types;
	-- pragma Shared_Passive;
	-- pragma Remote_Call_Interface;
    
    -- for Server'Read use GetInit;
    
	N : constant := 22; -- number of players.

	F : Field_Access := new Field(N);
	B : Ball_Access := new Ball(F);
	Tm : TimeCount_Access := new TimeCount;

	-- inizializzazione del moviment della palla
	T : TaskBall_Access := new TaskBall(F, B, 40);

    PP : Position;

	-- inizializzazione dell'array di giocatori
	Players : array (1..22) of Player_Access;

	-- inizializzazione delle squadre
	T1 : Team_Access := new Team;
	T2 : Team_Access := new Team;

	-- manager
	M1 : Manager_Access := new Manager(F, T1);
	M2 : Manager_Access := new Manager(F, T2);

	-- referee
	R : Referee_Access := new Referee (F, B);

	-- timer
	Tmr : Timer_Access;

    procedure GetInit (Field : in out Field_Access; Ball : in out Ball_Access; Time : in out TimeCount_Access; Timer : in out Timer_Access);
    
    function GetField return Field_Access;
    
    function GetBall return Ball_Access;

    function GetTime return TimeCount_Access;
    
    function GetTimer return Timer_Access;
    
    procedure Start;
   
end Server;
